/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include "物体/S_物体.h"


S_LightParallel* f_ob_calloc平行光();
S_LightSpot* f_ob_calloc聚光灯();
S_LightPoint* f_ob_calloc点光源();
S_LightArea* f_ob_calloc区域光();

void f_ligth_init_区域光(S_LightArea& ligth);


Inline S_灯光场景数据* f_light_calloc灯光场景数据(S_设备环境& ctx) {
	S_灯光场景数据* light = (S_灯光场景数据*)malloc(sizeof(S_灯光场景数据));
	(*light) = {};

	light->m_Ctx = ctx;
	light->m_阴影图 = (S_纹理组*)f_core_array_new_type(0, E_值类型::e_Type_纹理_1D);
	light->m_帧缓存 = (S_帧缓存组*)f_core_array_new(0, sizeof(S_帧缓存*));
	light->m_灯光阴影矩阵 = f_bm_alloc(f_buf_getGlobal().g_灯光投影矩阵, 1);
	return light;
}


void f_light_free灯光场景数据(S_灯光场景数据* light);



